import { createStore } from 'vuex'

const store = createStore({
  state: {
    username: ''
  },
  mutations: {
    SET_USERNAME(state, username) {
      state.username = username
    }
  },
  actions: {
    setUsername({ commit }, username) {
      commit('SET_USERNAME', username)
    }
  },
  getters: {
    getUsername: state => state.username
  }
})

export default store